const axios = require('axios')

const noRepeat = (arr) => {
  return arr.reduce((brr, item) => {
    brr.indexOf(item) === -1 && brr.push(item)
    return brr;
  }, [])
}

const get = (url, params) => {
  return axios.get(url, { params })
}

const post = (url, data) => {
  return axios.post(url, data)
}

module.exports = {
  noRepeat,
  get,
  post
}
